<?php

namespace App\Http\Controllers\Admin\Config\Attachment;

use Illuminate\Http\Request;
use App\Http\Controllers\AdminController;

use Symfony\Component\HttpFoundation\File\UploadedFile;

use App\Models\Attachment;

class UploadController extends AdminController
{


    /**
     * 上传图片
     * @param  Request $request [description]
     * @return [type]           [description]
     */
    function uploadPic(Request $request){
        $attachment = new Attachment();
        $attachment = $attachment->uploadPic($request,80);
        $this->ajaxJson(0,'上传图片成功',$attachment);
    }

    /**
     * 上传文件
     * @param  Request $request [description]
     * @return [type]           [description]
     */
    function uploadFile(Request $request){
        $attachment = new Attachment();
        $attachment = $attachment->uploadFile($request);
        $this->ajaxJson(0,'上传文件成功',$attachment);
    }

    /**
     * 上传视频
     * @param  Request $request [description]
     * @return [type]           [description]
     */
    function uploadVideo(Request $request){
        $attachment = new Attachment();
        $attachment = $attachment->uploadVideo($request);
        $this->ajaxJson(0,'上传视频成功',$attachment);
    }


    
}
